package com.ks.utils;

public class SUtilString {

	/** 首字母大写 */
	public static String firstUpper(String str) {
		if (isBlank(str)) {
			return str;
		}
		char[] chars = new char[1];
		chars[0] = str.charAt(0);
		String temp = new String(chars);
		if (chars[0] >= 'a' && chars[0] <= 'z') {
			return str.replaceFirst(temp, temp.toUpperCase());
		} else {
			return str;
		}
	}
	
	public static boolean isBlank(String str) {
		int strLen;
		if (str == null || (strLen = str.length()) == 0) {
			return true;
		}
		for (int i = 0; i < strLen; i++) {
			if ((Character.isWhitespace(str.charAt(i)) == false)) {
				return false;
			}
		}
		return true;
	}
	
}
